<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<title>用户中心</title>

<div class="row no-gutter" id="user-profile">
    <div class="col-md-4">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4>管理员</h4>
            </div>
            <div class="panel-body">
                    <img id="avatar" class="profile-img img-responsive center-block"
                         alt="管理员" src="${ctx}/assets/lib/img/admin1.png"/>
                    <div class="profile-label">
                        <span class="label label-danger divcenter">${sessionScope.currentAccount.status==0?'超级管理员':'普通管理员'}</span>
                    </div>
                    <div class="profile-since">
                        <c:if test="${empty  sessionScope.currentAccount.lastLoginAt}">
							您是第一次登录系统，请<a class="btn btn-link" href="${ctx}/changepwd">修改密码</a>
						</c:if>
						  
						<c:if test="${not empty sessionScope.currentAccount.lastLoginAt}">
							<a class="btn btn-link" data-original-title="" title="">
								<i class="glyphicon glyphicon-time green"></i> 
								您好，${ sessionScope.currentAccount.account},您上一次登录系统是： <br/>
								<fmt:formatDate value="${sessionScope.currentAccount.lastLoginAt }" pattern="yyyy-MM-dd HH:mm"/>
							</a>
						</c:if> 
                    </div>
                   <hr />
                    <div class="profile-message-btn center-block text-center">
                        <a href="${ctx}/updateHead" class="btn btn-success">
                            <i class="glyphicon glyphicon-edit"></i>
                            修改头像
                        </a>
                        <a href="${ctx}/changepwd" class="btn btn-info">
                            <i class="fa fa-unlock-alt"></i>
                            修改密码
                        </a>
                    </div>
            </div>
        </div>
    </div>
    <div class="col-md-8">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4>角色信息</h4>
            </div>
            <div class="panel-body">
                <table class="table">
                    <tbody>
                    <tr>
                        <td><h5>账号: <small>${sessionScope.currentAccount.account}</small></h5></td>
                    </tr>
                    <tr>
                        <td><h5>姓名: <small>${sessionScope.currentAccount.realName}</small></h5></td>
                    </tr>
                    <tr>
                        <td><h5>状态: <small>${sessionScope.currentAccount.locked?"已锁定":"未锁定"}</small></h5></td>
                    </tr>
                    <tr>
                        <td><h5>注册时间: <small>
                        <fmt:formatDate value="${sessionScope.currentAccount.createAt}" pattern="yyyy-MM-dd hh:mm"/>
                        </small></h5></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
